var app = getApp(), imgArray = [], uploaded = [];

Page({
    data: {
        hidden1: !1,
        hidden2: !0,
        hidden3: !0,
        index: 0,
		index2: 0,
        index_two: 0,
		e_index:0,
		w_index:0,
		s_index:0,
		s2_index:0,
		sex_index:1,
		public_index:1,
		m_index:0,
		view_id:0,
        prompt: !1,
        choise: !1,
        images: [],
        upload_img: [],
		view_info:[],
        upload_img_length: 0,
		hotel_logo:'',
		education_key: [ "1", "2", "3", "4", "5", "6", "7", "8", "9"],
		education_value: [ "小学", "初中", "高中", "中专", "大专", "本科", "硕士", "博士", "博士后"],
		working_key : [ "1","2","3","4","5"],
		working_value : [ "1年","2年","3年","4年","5年以上"],
		style_key : [ "1","2","3"],
		style_value : [ "全职","兼职","实习"],
		money_key : [ "1","2","3","4"],
		money_value : ["1000-3000","3000-5000","5000-10000","10000以上"],
		sex_arr : [
			 {name: '正在招聘', value: '1', checked: 'true'},
			 {name: '停招', value: '2'}
		]
    },
	bindMultiPickerChange: function(e) {
        console.log("picker发送选择改变，携带值为", e.detail.value), this.setData({
            multiIndex: e.detail.value
        });
    },
    onLoad: function(e) {
        var o = this;
        wx.setNavigationBarColor({
            frontColor: "#ffffff",
            backgroundColor: wx.getStorageSync("color"),
            animation: {
                duration: 0,
                timingFunc: "easeIn"
            }
        }), console.log(o.data);
        var t = wx.getStorageSync("url"), s = e.id,a = wx.getStorageSync("openid"), n = wx.getStorageSync("users").id;
		console.log(t);
        console.log("用户的openid为 " + a + " 用户的user_id为 " + n), app.util.request({
            url: "entry/wxapp/GetUserInfo",
            cachetime: "0",
            data: {
                user_id: n
            },
            success: function(e) {
				
            }
        }), o.setData({
            user_id: n,
            openid: a,
			view_id: s,
            url: t
		}), app.util.request({
            url: "entry/wxapp/MyResumeView",
            cachetime: "0",
			data: {
                vid: s
            },
            success: function(e) {
                console.log(e.data);
				e.data.person_logo = t + e.data.person_logo;
				o.setData({
					view_info: e.data
				})
            }
        })
    },
	radioChange: function(e) {
		console.log('radio发生change事件，携带value值为：', e.detail.value)
		this.setData({
		  sex_index: e.detail.value
		})
	},
	bindEduChanges: function(e) {
		console.log('picker发送选择改变，携带值为', e.detail.value)
		this.setData({
		  e_index: e.detail.value
		})
   },
   bindWorkChanges: function(e) {
		console.log('picker发送选择改变，携带值为', e.detail.value)
		this.setData({
		  w_index: e.detail.value
		})
   },
   bindStyleChanges: function(e) {
		console.log('picker发送选择改变，携带值为', e.detail.value)
		this.setData({
		  s2_index: e.detail.value
		})
   },
   bindMoneyChanges: function(e) {
		console.log('picker发送选择改变，携带值为', e.detail.value)
		this.setData({
		  m_index: e.detail.value
		})
   },
    bindPickerChanges: function(e) {
        var t = this, a = t.data.store, o = e.detail.value;
        this.setData({
            index: o,
            index_two: 0
        })
    },
    choice: function(e) {
        this.setData({
            choice: !0
        });
    },
    formSubmit: function(e) {
        var a = this;
		var var_t = e.detail.value.true_name;
		var var_t2 = e.detail.value.title;
		var var_t4 = e.detail.value.phone;
		var var_t5 = e.detail.value.textarea;
		var var_t6 = e.detail.value.number;
		if(var_t == "" || var_t2 == "" || var_t4 == "" || var_t5 == "" || var_t6 == "") {
			wx.showModal({
				title: "提示",
				content: "数据填写不完整",
				showCancel: !0,
				cancelText: "取消",
				confirmText: "确定",
				success: function(e) {},
				fail: function(e) {},
				complete: function(e) {}
			 });
		} else {
			 var o = wx.getStorageSync("openid");
			 app.util.request({
				url: "entry/wxapp/recruit",
				cachetime: "0",
				data: {
					rid:0,
					store_id: a.data.store_id,
					true_name:var_t,
					title:var_t2,
					is_status:a.data.sex_index,
					number:var_t6,
					education:a.data.education_key[a.data.e_index],
					work_year:a.data.working_key[a.data.w_index],
					style:a.data.style_key[a.data.s2_index],
					money:a.data.money_key[a.data.m_index],
					phone:var_t4,
					position:a.data.store[a.data.index]['id'],
					content:var_t5,
					form_id:e.detail.formId,
					open_id:o,
				},
				success: function(e) {
					 wx.showModal({
						title: "提示",
						content: "岗位招聘提交成功"
					}), setTimeout(function() {
						wx.reLaunch({
							url: "../recruit/lists?user_id="+a.data.store_id,
							success: function(e) {},
							fail: function(e) {},
							complete: function(e) {}
						});
					}, 2e3);
				}
			 })
		}
    },
    reset: function(e) {},
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});